package com.dayu.recovery.service.impl;

import java.util.List;

import com.dayu.common.annotation.DataScope;
import com.dayu.utils.constant.StockConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dayu.recovery.mapper.RecoveryStockMapper;
import com.dayu.recovery.domain.RecoveryStock;
import com.dayu.recovery.service.IRecoveryStockService;
import org.springframework.util.ObjectUtils;

/**
 * 仓库管理Service业务层处理
 * 
 * @author HK
 * @date 2021-04-16
 */
@Service
public class RecoveryStockServiceImpl implements IRecoveryStockService 
{
    @Autowired
    private RecoveryStockMapper recoveryStockMapper;

    /**
     * 查询仓库管理
     * 
     * @param stockId 仓库管理ID
     * @return 仓库管理
     */
    @Override
    public RecoveryStock selectRecoveryStockById(Long stockId)
    {
        return recoveryStockMapper.selectRecoveryStockById(stockId);
    }

    /**
     * 查询仓库管理列表
     * 
     * @param recoveryStock 仓库管理
     * @return 仓库管理
     */
    @Override
    public List<RecoveryStock> selectRecoveryStockList(RecoveryStock recoveryStock)
    {
        return recoveryStockMapper.selectRecoveryStockList(recoveryStock);
    }

    /**
     * 新增仓库管理
     * 
     * @param recoveryStock 仓库管理
     * @return 结果
     */
    @Override
    public int insertRecoveryStock(RecoveryStock recoveryStock)
    {
        return recoveryStockMapper.insertRecoveryStock(recoveryStock);
    }

    /**
     * 修改仓库管理
     * 
     * @param recoveryStock 仓库管理
     * @return 结果
     */
    @Override
    public int updateRecoveryStock(RecoveryStock recoveryStock)
    {
        return recoveryStockMapper.updateRecoveryStock(recoveryStock);
    }

    /**
     * 批量删除仓库管理
     * 
     * @param stockIds 需要删除的仓库管理ID
     * @return 结果
     */
    @Override
    public int deleteRecoveryStockByIds(Long[] stockIds)
    {
        return recoveryStockMapper.deleteRecoveryStockByIds(stockIds);
    }

    /**
     * 根据权力获取列表
     */
    @DataScope(deptAlias = "d", userAlias = "u")
    @Override
    public List<RecoveryStock> selectRecoveryStockListByPower(RecoveryStock recoveryStock) {
        return recoveryStockMapper.selectRecoveryStockListByPower(recoveryStock);
    }
}
